#include <iostream>
using namespace std;
int main()
{
    int n,i;
    long long a[51];
    a[2]=2;a[3]=2;
    while (cin>>n)
    {
        if (n==1)cout<<3<<endl;
        else
        {
            for (i=4;i<=n;i++)a[i]=a[i-2]*2+a[i-1];
            cout<<a[n]*3<<endl;
        }
    }
    return 0;
}
